package com.wyzz.hr.action;

import java.util.*;
import org.apache.axis.utils.StringUtils;

import com.wyzz.hr.base.BaseAction;
import com.wyzz.hr.base.Status;
import com.wyzz.hr.bo.IEmpSalaryAcctitemsBo;
import com.wyzz.hr.bo.IEmpsalarydatadefBo;
import com.wyzz.hr.pojo.Empsalarydatadef;
import com.wyzz.hr.spring.SpringBeanFactory;

public class DWRforAcctItemDef extends BaseAction implements Status {

	public DWRforAcctItemDef() {
	}

	public List getItemsByType(Integer type) {
		IEmpsalarydatadefBo defBo = (IEmpsalarydatadefBo) SpringBeanFactory
				.getBean("empsalarydatadefBo");
		List list = defBo.searchByType(type);
		if (list == null)
			return null;
		List result = new ArrayList();
		Empsalarydatadef def;
		for (Iterator i$ = list.iterator(); i$.hasNext(); result.add(def
				.getEsddName())) {
			def = (Empsalarydatadef) i$.next();
			result.add(def.getEsddId().toString());
		}

		return result;
	}

	public Empsalarydatadef getItemById(String esddId) {
		if (StringUtils.isEmpty(esddId)) {
			return null;
		} else {
			IEmpsalarydatadefBo defBo = (IEmpsalarydatadefBo) SpringBeanFactory
					.getBean("empsalarydatadefBo");
			return defBo.searchById(esddId);
		}
	}

	public List getAcctItemsById(String acctversionId) {
		IEmpSalaryAcctitemsBo acctItemBo = (IEmpSalaryAcctitemsBo) SpringBeanFactory
				.getBean("empsalaryacctitemsBo");
		return acctItemBo.getItemsByAcctversion(acctversionId);
	}

	private static final long serialVersionUID = 1L;
}
